<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/test/index', 'TestController@index');
Route::get('/test/fapiao', 'TestController@fapiao');


Route::get('/error/index', 'ErrorController@index');

Route::get('/', function () {
    return view('config.step_1');
});
Route::get('/config/disconnect', 'ConfigController@disconnect');
Route::post('/config/connectMysql', 'ConfigController@connectMysql');
Route::post('/config/testConnect', 'ConfigController@testConnect');


Route::get('/index/index', 'IndexController@index');
Route::get('/index/record', 'IndexController@record');
Route::get('/index/structure', 'IndexController@structure');
Route::get('/index/editField', 'IndexController@editField');
Route::get('/index/getFieldsData', 'IndexController@getFieldsData');
Route::get('/index/getListData', 'IndexController@getListData');
Route::get('/index/createTable', 'IndexController@createTable');
Route::get('/index/getSqlResult', 'IndexController@getSqlResult');
Route::get('/index/createField', 'IndexController@createField');
Route::get('/index/operation', 'IndexController@operation');
Route::get('/index/insertLine', 'IndexController@insertLine');
Route::get('/index/editTableLine', 'IndexController@editTableLine');


// 获取所有字符集
Route::get('/database/getAllCharset', 'DatabaseController@getAllCharset');
// 获取所有引擎
Route::get('/database/getAllEngine', 'DatabaseController@getAllEngine');
Route::get('/database/getAllDataType', 'DatabaseController@getAllDataType');
Route::get('/database/getAllDatabase', 'DatabaseController@getAllDatabase');
Route::post('/database/createDatabase', 'DatabaseController@createDatabase');
Route::post('/database/dropDatabase', 'DatabaseController@dropDatabase');
Route::post('/database/createTable', 'DatabaseController@createTable');
Route::post('/database/dropTable', 'DatabaseController@dropTable');
Route::post('/database/importSqlFile', 'DatabaseController@importSqlFile');
Route::get('/database/exportSqlFile', 'DatabaseController@exportSqlFile');
Route::post('/database/dropField', 'DatabaseController@dropField');
Route::post('/database/alterField', 'DatabaseController@alterField');
Route::post('/database/addField', 'DatabaseController@addField');
// 修改表名称
Route::post('/database/alterTableName', 'DatabaseController@alterTableName');
// 清空数据表
Route::post('/database/emptyTableData', 'DatabaseController@emptyTableData');
// 执行原生sql
Route::post('/database/executeSql', 'DatabaseController@executeSql');
// 修改表注释
Route::post('/database/updateTableComment', 'DatabaseController@updateTableComment');
// 新增表数据
Route::post('/database/insertNewData', 'DatabaseController@insertNewData');




// 【弹框路由】
Route::get('/layer/createDb', 'LayerController@createDb');
Route::get('/layer/console', 'LayerController@console');
Route::get('/layer/engineDesc', 'LayerController@engineDesc');

/** 上传路由 **/
Route::post('/upload/index', 'UploadController@index');
